package com.vietnam.power.persistence;

import java.io.Serializable;

import javax.persistence.*;

import com.vietnam.power.dao.IAuditTable;

import java.util.Date;

/**
 * The persistent class for the product_report database table.
 * 
 */
@Entity
@Table(name = "product_report")
public class ProductReport implements Serializable, IAuditTable {
	private static final long serialVersionUID = 1L;
	private Long productReportId;
	private Date createdDate;
	private String description;
	private Product product;
	private UserInfo createdBy;

	public ProductReport() {
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "PRODUCT_REPORT_ID")
	public Long getProductReportId() {
		return this.productReportId;
	}

	public void setProductReportId(Long productReportId) {
		this.productReportId = productReportId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATED_DATE")
	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	// bi-directional many-to-one association to Product
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PRODUCT_ID")
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Override
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CREATED_BY")
	public UserInfo getCreatedBy() {
		return this.createdBy;
	}

	@Override
	public void setCreatedBy(UserInfo createdBy) {
		this.createdBy = createdBy;
	}

}